import datetime
from typing import Optional

from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel

from module_admin.annotation.pydantic_annotation import as_query


class FutureStrategyParamModel(BaseModel):
    """
    期货策略参数表对应pydantic模型
    """

    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)

    id: Optional[int] = Field(default=None, description='参数id')
    strategy_instance: Optional[str] = Field(default=None, description='策略实例名称')
    param_name: Optional[str] = Field(default=None, description='参数名称')
    param_value: Optional[str] = Field(default=None, description='参数值')
    create_time: Optional[str] = Field(default=None, description='创建时间')
    update_time: Optional[str] = Field(default=None, description='更新时间')


@as_query
class FutureStrategyParamQueryModel(FutureStrategyParamModel):
    """
    期货策略参数管理不分页查询模型
    """
    pass


@as_query
class FutureStrategyParamPageQueryModel(FutureStrategyParamQueryModel):
    """
    期货策略参数管理分页查询模型
    """

    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=10, description='每页记录数')


class DeleteFutureStrategyParamModel(BaseModel):
    """
    删除期货策略参数模型
    """

    ids: list[int] = Field(description='参数id列表')